From: Roger Pau Monne Date: Thu, 11 Jan 2018 11:41:21 +0000 (+0000) Subject: xen/shim: crash instead of reboot in shim mode X-Git-Tag: archive/raspbian/4.11.1-1+rpi1~1^2~66^2~771 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=96332997037c7125157fe1d025310360ce0a9281;p=xen.git xen/shim: crash instead of reboot in shim mode All guest shutdown operations are forwarded to L0, so the only native calls to machine_restart happen from crash related paths inside the hypervisor, hence switch the reboot code to instead issue a crash shutdown. Signed-off-by: Roger Pau Monné Acked-by: Jan Beulich [ wei: fix arm build ] Signed-off-by: Wei Liu --- diff --git a/xen/arch/x86/shutdown.c b/xen/arch/x86/shutdown.c index 689f6f137d..a350714319 100644 --- a/xen/arch/x86/shutdown.c +++ b/xen/arch/x86/shutdown.c @@ -642,7 +642,12 @@ void machine_restart(unsigned int delay_millisecs) break; case BOOT_XEN: - xen_hypercall_shutdown(SHUTDOWN_reboot); + /* + * When running in PV shim mode guest shutdown calls are + * forwarded to L0, hence the only way to get here is if a + * shim crash happens. + */ + xen_hypercall_shutdown(pv_shim ? SHUTDOWN_crash : SHUTDOWN_reboot); break; } } diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 18f5b7f7aa..121073c8ed 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -1253,7 +1253,11 @@ void panic(const char *fmt, ...) if ( opt_noreboot ) printk("Manual reset required ('noreboot' specified)\n"); else +#ifdef CONFIG_X86 + printk("%s in five seconds...\n", pv_shim ? "Crash" : "Reboot"); +#else printk("Reboot in five seconds...\n"); +#endif spin_unlock_irqrestore(&lock, flags);